<?php
	require_once '../../model/global.inc.php';  
?>
<?php
 if(isset($_GET['file'])) {
	require_once "../json/JSON.php";
	$json = new Services_JSON();
	$id = $_GET['file'];
	//convert php object to json 
	
	$result = mysql_query("select * from tblcountry where country_name = '$id'");            //query
        $res = mysql_fetch_array($result);
        $a = $res['country_id'];
        
        $sql = mysql_query("SELECT * from tblcountry where parent = '$a' order by country_name");            //query
        $data = array();
        while ($row = mysql_fetch_assoc($sql, MYSQL_ASSOC)) { 
                $data[] = $row;  
        }
        $output = json_encode($data);
        print($output);
}
?>